<div class="wrapper wrapper-content fadeInRight" ng-controller="articleCtr">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>最新公告</h5>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-12 pull-left">
                            <form class="form-inline">
                                <div class="form-group">
                                    <input class="form-control" ng-model="data.search.title" placeholder="标题">
                                </div>
                                <button class="btn btn-primary no-margins" ng-click="getList(1)">搜索</button>
                                <button class="btn btn-success pull-right" access="ArticleSave" ng-click="edit()">添加</button>
                            </form>
                        </div>
                    </div>
                    <table class="table table-bordered table-hover" style="text-align:center;">
                        <thead>
                        <tr>
                            <td>序号</td>
                            <td>标题</td>
                            <td>状态</td>
                            <td>添加时间</td>
                            <td>操作</td>
                        </tr>
                        </thead>
                        <tbody>
                        <tr ng-repeat="item in data.list">
                            <td>{{getItemIndex($index, data.search.page, data.search.pageSize)}}</td>
                            <td>{{item.title}}</td>
                            <td>
                                <span class="text text-success" ng-if="item.status==1">启用</span>
                                <span class="text text-warning" ng-if="item.status==2">禁用</span>
                            </td>
                            <td>{{item.create_time}}</td>
                            <td>
                                <a class="btn btn-xs btn-warning" access="ArticleSave" ng-click="edit(item)">编辑</a>
                                <a class="btn btn-xs btn-danger" access="ArticleDelete" ng-click="del(item)">删除</a>
                            </td>
                        </tr>
                        <tr no-data="data.list"></tr>
                        </tbody>
                    </table>
                    <div admin-page="data.pages" curr-page="data.search.page" datas-count="data.count" callback="getList"></div>
                </div>
            </div>
        </div>
    </div>

    <div class="modal fade" id="myModal" tabindex="1" role="dialog" data-backdrop="static">
        <div class="modal-dialog" role="document" style="width: 1200px">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="close"><span
                            aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">编辑</h4>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal" id="editForm" ng-if="data.editInit">

                        <div class="form-group">
                            <label class="col-sm-2 control-label">标题</label>
                            <div class="col-sm-9">
                                <input class="form-control" type="text" ng-model="data.edit.title" name="title" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">启用状态</label>
                            <div class="col-sm-8">
                                <label>启用
                                    <input type="radio" name="use_status" ng-model="data.edit.status" value="1">
                                </label>
                                <label>
                                    禁用
                                    <input type="radio" name="use_status" ng-model="data.edit.status" value="2">
                                </label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">内容</label>
                            <div class="col-sm-9">
                                <textarea id="content" editor ng-model="data.edit.content" name="content" required></textarea>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-defualt" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary" ng-click="commit()" access="ArticleSave">保存</button>
                </div>
            </div>
        </div>
    </div>


</div>